package com.leanit.pmc.center.decl;

import com.leanit.pmc.center.enterprise.EnterPriseInfo;
import com.leanit.pmc.center.user.UserInfo;
import com.leanit.pmc.common.bean.GridRequest;
import com.leanit.pmc.common.bean.GridResult;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;

/**
 * 用户信息管理Controller
 */
@Controller
@RequestMapping("record")
@Scope("prototype")
public class RecordMgnController {

    private final org.slf4j.Logger logger = LoggerFactory.getLogger(RecordMgnController.class);


    /**
     * 申报主体备案页面跳转
     *
     * @param request
     * @param map
     * @return
     */
    @RequestMapping(value = "declEnterprise", method = RequestMethod.GET)
    public String declEnterprise(HttpServletRequest request, ModelMap map) {
        map.addAttribute("userInfo", request.getSession().getAttribute("UserInfo"));
        return "center/decl/decl_enterprise";
    }

    /**
     * 查询申报主体备列表
     * 暂时实现列表查询    展示功能
     * @param request
     * @return
     */
    @RequestMapping(value = "/queryRecordList")
    @ResponseBody
    public GridResult queryRecordList(GridRequest request,EnterPriseInfo enterPriseInfo, HttpSession session) {
        UserInfo info= (UserInfo) session.getAttribute("UserInfo");
        List usInfList=new ArrayList<UserInfo>();
//        usInfList.add(info);
        return new GridResult(usInfList,request, 0);
    }

    @RequestMapping(value = "enterpriseDeclDetail", method = RequestMethod.GET)
    public String enterpriseDeclDetail() {
        return "center/decl/enterprise_decl_detail";
    }

}
